package com.bishe.demo.modules.tourism.dao;

import com.bishe.demo.modules.tourism.entity.RouteImage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

/**
 * @Description RouteImageDao
 * @Author Lubb
 * @Date 2021/3/30 13:15
 */
@Repository
@Mapper
public interface RouteImageDao {
    @Insert("insert into tourism_route_image(route_id,image_id) values(#{routeId},#{imageId})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    void addRouteImage(RouteImage routeImage);

    @Delete("delete from tourism_route_image where route_id = #{routeId}")
    void deleteRouteImageByRouteId(Integer routeId);

    @Delete("delete from tourism_route_image where image_id = #{imageId}")
    void deleteRouteImageByImageId(Integer imageId);
}
